package tests.pojos;

import tests.pojos.Pet;

public class Cat extends Pet{
	boolean isLongHaired;
	
	public Cat(String name, boolean isLongHaired){
		super(name);
		this.isLongHaired = isLongHaired;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = super.hashCode();
		result = prime * result + (isLongHaired ? 1231 : 1237);
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (!super.equals(obj))
			return false;
		if (getClass() != obj.getClass())
			return false;
		Cat other = (Cat) obj;
		if (isLongHaired != other.isLongHaired)
			return false;
		return true;
	}
}
